﻿namespace 高级控件演示;

/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{


    public MainWindow()
    {

        InitializeComponent();

        MenuToggleButton.Visibility = Visibility.Collapsed;
        NavRail.Visibility = Visibility.Collapsed;
    }


    private void MenuOpen_Click(object sender, RoutedEventArgs e)
    {
        NavDrawer.IsLeftDrawerOpen = false;
        if (ActualWidth > 1000)
        {
            NavRail.Visibility = Visibility.Visible;
            MenuToggleButton.Visibility = Visibility.Visible;
        }

    }


    private void MenuToggleButton_OnClick(object sender, RoutedEventArgs e)
    {
        if (ActualWidth > 1000)
        {
            NavRail.Visibility = Visibility.Collapsed;
            MenuToggleButton.Visibility = Visibility.Collapsed;
        }

    }


    /// <summary>
    /// TreesView's SelectedItem is read-only. Hence we can't bind it. There is a way to obtain a selected item.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
    {

    }
}
